<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>增加挂号信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<LINK href="<%=basePath%>css/milkwhite.css" type=TEXT/CSS
			rel=StyleSheet></LINK>
		<LINK href="<%=basePath%>css/htmilkwhite.css" type=TEXT/CSS
			rel=StyleSheet></LINK>
		<LINK href="<%=basePath%>css/dhtmlxgrid.css" type=TEXT/CSS
			rel=StyleSheet></LINK>
		<SCRIPT src="<%=basePath%>js/list/dhtmlxcommon.js"
			type=text/javascript></SCRIPT>
		<SCRIPT src="<%=basePath%>js/list/dhtmlxgrid.js" type=text/javascript></SCRIPT>
		<SCRIPT src="<%=basePath%>js/list/dhtmlxgridcell.js"
			type=text/javascript></SCRIPT>
		<SCRIPT src="<%=basePath%>js/list/dhtmlxgrid_start.js"
			type=text/javascript></SCRIPT>
			<script type="text/javascript" language="javascript" src="<%=basePath%>js/commom/common.js"></script>
			<script type="text/javascript">
		//**************加载日期控件***************
		var oCalendarEn=new PopupCalendar('oCalendarEn');	//初始化控件时,请给出实例名称如:oCalendarEn
            oCalendarEn.Init();
        var oCalendarChs=new PopupCalendar('oCalendarChs');	//初始化控件时,请给出实例名称:oCalendarChs
            oCalendarChs.weekDaySting=new Array('日','一','二','三','四','五','六');
            oCalendarChs.monthSting=new Array('一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月');
            oCalendarChs.oBtnTodayTitle='今天';
            oCalendarChs.oBtnCancelTitle='取消';
            oCalendarChs.Init();
        //***********************
        </script>
  </head>
  
  <body>
   <%
     String num =(String)request.getAttribute("num");
     String isFirst =(String)request.getAttribute("isFirst");
   %> 
    <s:form name="ghRecordForm" action="" method="post" theme="simple">
             <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0
											align="center">
											<TBODY>
												<TR>
													<TD class=linelabel3 vAlign=bottom
														background=<%=basePath%>images/commom/00_r5_c30.jpg>
														挂号管理>>门诊挂号>>新建挂号记录
													</TD>
												</TR>
											</TBODY>
										</TABLE>
             <table border ="1" width = "100%">
                <tr>
  					<td width="150">病历号:</td>
  					<td width="150"><input type="text" name="num" width="150"></td>
  					<td width="100"><img src="<%=basePath%>images/gh/but_chaxun.gif" style="cursor: hand" onclick="search()"></td>
  					<td><img src="<%=basePath%>images/gh/save.gif" style="cursor: hand" onclick="save()"></td>
  				</tr>
             </table>
  			 <table border ="1" width = "100%">
  				<tr>
  					<td>病历号:</td>
  					<td><s:textfield name="recordVo.num" readonly="true" value="<%=num%>"/></td>
  					<td>患者姓名:</td>
  					<td><s:textfield name="recordVo.name"/></td>
  				</tr>
  				<tr>
  					<td>挂号科室:</td>
  					<td><s:select name="recordVo.department" list="#request.departList" listKey="id"  
listValue="name" headerKey="0" headerValue="--请选择科室--"  cssStyle="width:134px" />		
  					</td>
  					<td>医生姓名:</td>
  					<td><s:textfield name="recordVo.doctor"/></td>
  				</tr>
  				<tr>
  					<td>证件类型:</td>
  					<td><s:select name="recordVo.idType" list="#request.certiList" listKey="id"  
listValue="name" headerKey="0" headerValue="--请选择证件类型--" cssStyle="width:134px"/>
  					</td>
  					<td>证件号:</td>
  					<td><s:textfield name="recordVo.idNum"/></td>
  				</tr>
  				<tr>
  					<td>患者性别:</td>
  					<td><s:select name="recordVo.sex" list="#request.sexList" listKey="id"  
listValue="name" headerKey="0" headerValue="--请选择性别--" cssStyle="width:134px"/></td>
  					<td>出生日期:</td>
  					<td><s:textfield name="recordVo.birthday" onclick='getDateString(this,oCalendarChs)'/></td>
  				</tr>
  				<tr>
  					<td>联系电话:</td>
  					<td><s:textfield name="recordVo.telephone"/></td>
  					<td>患者职业:</td>
  					<td><s:select name="recordVo.professional" list="#request.jobList" listKey="id"  
listValue="name" headerKey="0" headerValue="--请选择职业--" cssStyle="width:134px"/></td>
  				</tr>
  				<tr>
  					<td>挂号类别:</td>
  					<td><s:select id = "ghType" name="recordVo.type" list="#request.typeList" listKey="id"  
listValue="name" onchange="changeType()" cssStyle="width:134px"/></td>
  					<td>挂号费:</td>
  					<td><s:textfield id="fees" name="recordVo.fees" value="3元"/></td>
  				</tr>
  				<tr>
  					<td>初复诊:</td>
  					<td><s:textfield name="recordVo.isFirst" readonly="true" value="<%=isFirst%>"/></td>
  					<td>&nbsp;</td>
  					<td>&nbsp;</td>
  				</tr>
  				
  			</table>
  		  </s:form>
  </body>
</html>
<script language="javascript">
  function save(){
      //获取JSP页面中的一个表单元素 
      recordForm = document.forms[0]; 
      //动态修改目标表单的action属性 
      recordForm.action = "/chis/gh/record!addRecord.action"; 
      //提交表单 
      recordForm.submit();  
  }
  
  function search(){
    //获取JSP页面中的一个表单元素 
    var num = document.getElementById("num").value;
      recordForm = document.forms[0]; 
      //动态修改目标表单的action属性 
      recordForm.action = "/chis/gh/record!searchPatientInfo.action?num="+num; 
      //提交表单 
      recordForm.submit(); 
  }
  
  function changeType(){
   // var type = document.all.ghType.value;
   var sel_obj = document.all.ghType;
   var index = sel_obj.selectedIndex;
   //alert(sel_obj.options[index].value);
   //alert(sel_obj.options[index].text); 
   var type = sel_obj.options[index].text;
   var expert = "专家";
   if(type==expert){
   document.all.fees.value = "5元";
   }
   else{
     document.all.fees.value = "3元";
   }
  }
  
</script>
